package homework2;


import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;

import java.nio.charset.StandardCharsets;

public class producer {
    public static void main(String[] args) throws Exception {
        DefaultMQProducer producer = new DefaultMQProducer("nom_pud_group");
        producer.setNamesrvAddr("localhost:9876");
        producer.start();
        Message message = new Message("con", "sd", "世界最高城".getBytes(StandardCharsets.UTF_8));
        SendResult send = producer.send(message);
        System.out.println(send);
        producer.shutdown();
    }
}
